﻿using System;

using System.Collections.Generic;
using System.Text;
using DirectUI.Mobile.UI.Controls;

using System.Drawing;
using DirectUI.Mobile.UI.Drawing.GdiPlus;
namespace RecorderSample.View
{
    public class AudioButtonPanel : DirectUIPanel
    {

        public const int ButtonWidth = 40;
        public const int ButtonHeight = 43;
        const int ButtonTop = 0;
        const int Space = 15;
        protected override void InitControl()
        {
            base.InitControl();
       
            BackGroundImage = Resource.btPanel;
            //BackColor = theme.ButtonsBackColor;
            //GradientFill = theme.ButtonsGradianted;
            //GradientFillOffset = 25;
            Bounds = new System.Drawing.Rectangle(0, 0, 240, 40);
         //   GradientFillOffset = 25;
            buttons[0] = btn1 = new DirectUIButton("", Space, ButtonTop, ButtonWidth, ButtonHeight);
            buttons[1] = btn2 = new DirectUIButton("", buttons[0].Left + ButtonWidth + Space, ButtonTop, ButtonWidth, ButtonHeight);
            buttons[2] = new DirectUIButton("", buttons[1].Left + buttons[1].Width + Space, ButtonTop, ButtonWidth, ButtonHeight);
            buttons[3] = new DirectUIButton("", buttons[2].Left + buttons[2].Width + Space, ButtonTop, ButtonWidth, ButtonHeight);
            buttons[0].Image = Resource.AudioBack;
            buttons[1].Image = Resource.AudioStop;
            buttons[2].Image = Resource.Audioplay;
            buttons[3].Image = Resource.AudioRecord;
            btn1.Command = "Back";
            buttons[1].Command = "Stop";
            buttons[2].Command = "Play";
            buttons[3].Command = "Record";
            MakeButtonsGlowing();

        }

        private void MakeButtonsGlowing()
        {
            foreach (DirectUIButton btn in buttons)
            {
                //  btn.PressedBackColor = Color.DarkBlue;
                btn.BackColor = Color.Transparent;
                btn.ForeColor = Color.White;
                btn.Shape = ButtonShape.Flat;

                this.Controls.Add(btn);
            }
        }



        DirectUIButton[] buttons = new DirectUIButton[4];

        public DirectUIButton[] Buttons { get { return buttons; } }

        DirectUIButton btn1;
        DirectUIButton btn2;




    }
}
